import axios from 'axios'

import { BASE_URL } from '../assets/js/constant'

export default function request(config) {
  // 创建实例对象
  const instance = axios.create({
    baseURL: BASE_URL,
    timeout: 5000,
  })

  // 设置响应拦截器
  instance.interceptors.response.use(res => {
    return res.data
  }, err => { })

  return instance(config)

}